{include file="header"}
<div style="padding: 20px;" class="adminmyucms">
<form class="layui-form" action="">
	<input type="hidden" name="id" value="{$c['id']}">	
  <div class="layui-form-item">
    <label class="layui-form-label">名称</label>
    <div class="layui-input-block">
      <input type="text" name="title" value="{$c['title']}" required  lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">状态</label>
    <div class="layui-input-block">
              <select name="open" lay-verify="required">
        <option value=""></option>
        <option value="1" {if condition="$c['open'] eq '1'"}selected="selected"{/if}>显示</option>
        <option value="0" {if condition="$c['open'] eq '0'"}selected="selected"{/if}>隐藏</option>
      </select>
    </div>
  </div>
  <div class="layui-form-item">
  	<div class="layui-input-block">
    权限 选择选择后 该权限组将不能操作选择后的链接
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
        {foreach name=":fun_S('cateAdmin',array('tid'=>0),'px desc','1000',1)" item="v" key="k"}
         <hr style="background-color: #FFF">
         
           <input type="checkbox" name="qx[{$v.id}]" value="{$v.id}" title="{$v.name}"  {if condition="socha($c['qx'],$v['id']) eq '1'"}checked{/if}>
        <hr style="background-color: #FFF">
          	{volist name=":fun_S('cateAdmin',array('open'=>1,'tid'=>$v['id']),'id desc','1000',1)" id="vo"}
          	
          	<input type="checkbox" name="qx[{$vo.id}]" value="{$vo.id}" title="{$vo.name}"  {if condition="socha($c['qx'],$vo['id']) eq '1'"}checked{/if}>

            {/volist} 
   
        {/foreach} 
    </div>
  </div>

  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="set">立即提交</button>
    </div>
  </div>
</form>
 
</div> 
<script>
layui.use('form',function(){
  var form = layui.form
  ,jq = layui.jquery;
  //更新
  form.on('submit(set)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("user/updatezu")}',param,function(data){
      if(data.code == 1){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.reload();
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });

})
</script>
{include file="footer"}